<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Vue数据双向绑定</title>
</head>
<body>
  <div id="app">
    <h3>{{num1+num2}}</h3>
    <h2>|---{{username}}----|</h2>
    <div>
      <input type="text" name="" id="" v-model.number="num1">+
      <input type="text" name="" id="" v-model.number="num2">
    </div>
    <input type="text" name="" id="" v-model.trim="username">
  </div>
  <script src="vue.js"></script>
  <script>
    const vm  = new Vue({
      el:"#app",
      data:{
        num1:10,
        num2:20,
        username:''
      },
    })
  </script>
</body>
</html>